<template>
  <el-form :model="formData" label-width="auto" ref="formRef" size="large">
    <el-form-item label="项目名称" prop="name">
      <el-input v-model="formData.name" placeholder="请输入"></el-input>
    </el-form-item>

    <el-form-item label="项目类型" prop="type">
      <el-select v-model="formData.type" placeholder="请选择">
      </el-select>
    </el-form-item>

    <el-form-item label="责任单位" prop="zrdw">
      <el-select v-model="formData.zrdw" placeholder="请选择">
      </el-select>
    </el-form-item>

    <el-form-item label="建设单位" prop="jsdw">
      <el-select v-model="formData.jsdw" placeholder="请选择">
      </el-select>
    </el-form-item>

    <el-form-item label="项目内容" prop="xmlr">
      <el-input v-model="formData.xmlr" placeholder="请输入"></el-input>
    </el-form-item>

    <el-form-item label="项目完成时间" prop="wcsj">
      <el-date-picker
        v-model="formData.wcsj"
        type="datetime"
        placeholder="请选择"
      />
    </el-form-item>

    <el-form-item label="经度" prop="jd">
      <el-input v-model="formData.jd" placeholder="请输入"></el-input>
    </el-form-item>

    <el-form-item label="纬度" prop="wd">
      <el-input v-model="formData.wd" placeholder="请输入"></el-input>
    </el-form-item>

    <el-form-item>
      <el-col :span="24" style="text-align: center">
        <el-button size="large" @click="resetForm">重置</el-button>

        <el-button size="large" type="primary" @click="confirm">存档</el-button>
      </el-col>
    </el-form-item>
  </el-form>
</template>

<script setup lang="ts">
import Mitt from "@/utils/mitt";
import type { ComponentSize, FormInstance, FormRules } from "element-plus";
const formData = reactive({
  name: "",
  type: "",
  zrdw: "",
  jsdw: "",
  xmlr: "",
  wcsj: "",
  jd: "",
  wd: "",
});

const formRef = ref<FormInstance>();

function resetForm() {
    formRef.value.resetFields();
}

function confirm(){
    Mitt.emit('close-dialog')
}
</script>

<style lang="less" scoped></style>
